// 客户端代码
import java.net.*;
import java.io.*;

public class Client {
    public static void main(String[] args) throws IOException {
        String host = "localhost"; // 服务器地址
        int port = 6868; // 端口号
        Socket socket = new Socket(host, port);
        System.out.println("已连接到服务器：" + host);

        OutputStream output = socket.getOutputStream();
        PrintWriter writer = new PrintWriter(output, true);
        writer.println("Hello, Server!");

        socket.close();
    }
}